import {Code_order_status,get_kehu} from "@/api/product/flOrderManagement/index";
//1.查字典方法(异步) async
//用法:
//async function F(){
//     let variable= await CODE_FUN('XXX') 
// }
export const CODE_FUN=async function(character){
    let renArr=[]
    await Code_order_status(character).then(response=>{
        for(let i=0;i<response.data.length;i++){
            let obj={}
            obj['value']=response.data[i].typeCode
            obj['label']=response.data[i].typeName
            renArr.push(obj)
        }
    })
    return renArr
}
//2查客户方法
// {"id":"1260139994668990464","parentId":"1","parentName":"沣澜厂商","parentType":"1","parentCode":"001","childrenCode":"005","childrenType":"2","childrenId":"3","childrenName":"东平厂商"},
// {"id":"1260139994807402496","parentId":"1","parentName":"沣澜厂商","parentType":"1","parentCode":"001","childrenCode":"009","childrenType":"2","childrenId":"9","childrenName":"平政通厂商"},
// {"id":"1260139994950008832","parentId":"1","parentName":"沣澜厂商","parentType":"1","parentCode":"001","childrenCode":"1688","childrenType":"2","childrenId":"1260139114481713152","childrenName":"经销商测试"}
export const CLIENT_FUN= async function(){
    let ARR=[]
    await get_kehu().then(response=>{
        for(let i=0;i<response.data.length;i++){
            let obj={}
            obj['value']=response.data[i].childrenName
            obj['label']=response.data[i].childrenName
            ARR.push(obj)
        }
    })
    return ARR
}